namespace Angelus.Data.Linq.OracleClient
{
    using System.Collections.Generic;
    using System.Data.DLinq;
    using System.Data.DLinq.Provider;
    using System.Data.OracleClient;

    /// <summary>
    /// 
    /// </summary>
    internal class OracleStoredProcedureMultipleResult : StoredProcedureMultipleResult
    {
        #region Fields

        private readonly OracleStoredProcedureResultImpl _result;

        #endregion

        #region Constructors

        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        /// <param name="command"></param>
        /// <param name="function"></param>
        internal OracleStoredProcedureMultipleResult(OracleContext context, OracleCommand command, MetaFunction function)
        {
            this._result = new OracleStoredProcedureResultImpl(context, command, function, false);
        }

        #endregion

        #region Properties

        /// <summary>
        /// 
        /// </summary>
        public override int? ReturnValue
        {
            get { return this._result.ReturnValue; }
        }

        #endregion

        #region Stored Procedure Result Overrides

        /// <summary>
        /// 
        /// </summary>
        public override void Dispose()
        {
            this._result.Dispose();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="parameterIndex"></param>
        /// <returns></returns>
        public override object GetParameterValue(int parameterIndex)
        {
            return this._result.GetParameterValue(parameterIndex);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public override IEnumerable<T> GetResults<T>()
        {
            return this._result.GetResults<T>();
        }

        #endregion
    }
}